﻿using System;
using WAD.WEB.AppCode;

namespace WAD.WEB.Client2.Page
{
    public partial class GetHtml : WebBase
    {
        protected string html;
        protected void Page_Load(object sender, EventArgs e)
        {
            string source = Parse.String("source", "");
            if (source.Equals("toutiao"))
                TouTiao();
        }

        //头条源码,返回json格式数据，客户端以<script>引用
        void TouTiao()
        {
            string id = Parse.String("id");
            if (!string.IsNullOrEmpty(id))
                html = HttpTool.GetHttpString("http://m.toutiao.com/i" + id + "/info/", true);
            if (string.IsNullOrEmpty(html))
                html = "var json={}";
            else
                html = "var json=" + html;
        }
    }
}